package com.boxin.ims.modules.sys.scheduler;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.boxin.ims.modules.wechat.service.WechatDaoHelper;

/**
 * @author Jakemanse
 * @date 2013-10-18
 * @function <p> 过期处理 </p>
 */
@Service
public class OvertimeProcessScheduler  extends AbstractScheduler{
	
	private Logger logger = Logger.getLogger(OvertimeProcessScheduler.class);
	@Autowired
	WechatDaoHelper wechatDaoHelper;
	
	public OvertimeProcessScheduler(){
		super();
	}

	@Override
	public String frequency() {
		return this.getSchedulerInfo().getFrequence(); 
	}

	@Override
	public void process() {
		//1.更新抽奖过期
		wechatDaoHelper.updateOvertimeLottery();
		logger.debug("执行 抽奖 的过期作废");
		//2.优惠券
		wechatDaoHelper.updateOvertimeCoupon();
		logger.debug("执行 优惠券 的过期作废");
		//3.转发
		wechatDaoHelper.updateOvertimeShare();
		logger.debug("执行 转发有奖 的过期作废");
		//4.秒杀
		wechatDaoHelper.updateOvertimeSeckill();
		logger.debug("执行 秒杀 的过期作废");
		
		
	}

}
